<?php

namespace Core\Session;

use Core\Config;
use Model\User;
use Zend\Session\Container;

class ApplicationSessionHelper{

    private static $_instance;

    private static function getNameSpaceInstance(){
        if(!self::$_instance)
            self::$_instance =new Container(Config::getAdminSessionNameSpace());
        return self::$_instance;
    }


    public static function getCurrentModule()
    {
        $mySession = self::getNameSpaceInstance();
        return $mySession->current_module;
    }

    public static function setCurrentModule($module)
    {
        $mySession = self::getNameSpaceInstance();
        $mySession->current_module = $module;
    }



    public static function setCurrentController($controller)
    {
        $mySession = self::getNameSpaceInstance();
        $mySession->current_controller = $controller;
    }

    public static function getCurrentController()
    {
        $mySession = self::getNameSpaceInstance();
        return $mySession->current_controller;
    }

    public static function setCurrentAction($action)
    {
        $mySession = self::getNameSpaceInstance();
        $mySession->current_action = $action;
    }

    public static function getCurrentAction()
    {
        $mySession = self::getNameSpaceInstance();
        return $mySession->current_action;
    }
}